package com.sdsy.blockchaintrainingback.controller.user;

import com.sdsy.blockchaintrainingback.pojo.common.CommonResult;
import com.sdsy.blockchaintrainingback.service.user.UserService;
import com.sdsy.blockchaintrainingback.vo.user.UserQueryVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.sdsy.blockchaintrainingback.pojo.common.CommonResult.success;

/**
 * @Description TODO
 * @Author linzili
 * @Date 2023/9/26 10:23
 * @Version 1.0
 */
@Tag(name = "用户信息")
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/profile")
    @Operation(summary = "获取用户信息")
    public CommonResult<UserQueryVo> profile() {
        return success(userService.getUserProfile());
    }

}
